"""predict URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.views.generic import RedirectView

from WebSite.views.misc import captcha
from WebSite.views.app.app import index, register, logout, description_page, history_page, predict_page, submit_predict, \
	guide, svm_page, ensemble_page, knn_page, history_data, neural_page, type_predict
from WebSite.views.app.user import user_register, user_login

urlpatterns = [
	url(r'^$', RedirectView.as_view(url='/index')),
	url(r'^index$', index, name='index'),

	# 登录注册
	url(r'^register$', register),
	url(r'^user_register$', user_register),
	url(r'^login$', user_login, name='login'),
	url(r'^logout$', logout),

	# 预测
	url(r'^predict$', predict_page),
	url(r'^predict/svm$', svm_page),
	# url(r'^predict/ensemble$', ensemble_page),
	# url(r'^predict/knn$', knn_page),
	# url(r'^predict/neural', neural_page),
	url(r'^predict/(?P<predict_type>[a-z]+)$', type_predict),
	url(r'^submit_predict$', submit_predict),

	# 其他功能页面
	url(r'^history$', history_page),
	url(r'^history_data$', history_data),
	url(r'^guide$', guide),
	url(r'^description$', description_page),

	# 验证码
	url(r'^captcha$', captcha)
]
